// ssl 和 http一起使用
var express = require('express');
var fs = require('fs');
var http = require('http');
var https = require('https');

var options = {
    key: fs.readFileSync('ssl/2_asay.pub.key'),
    cert: fs.readFileSync('ssl/1_asay.pub_bundle.crt')
};
var app = express();

https.createServer(options, app).listen(443, function() {
    console.log('https server started successfully.');
});

http.createServer(app).listen(80, function() {
    console.log('http server started successfully.');
});

app.get('/', function (req, res) {
    res.send('local root');
});


